﻿<ad:DocumentContent x:Class="XCase.Gui.Windows.XMLSchemaWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Dialogs="clr-namespace:XCase.Controller.Dialogs;assembly=Controller"
    xmlns:avalonEdit="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
	Title="XML Schema" FloatingWindowSize="645, 600">
    <ad:DocumentContent.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/ResourceLibrary;component/Images/Images.xaml" ></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </ad:DocumentContent.Resources>
    <DockPanel>
		<ToolBar DockPanel.Dock="Top">
			<!--<Button Width="200" Click="Button_Click">Open in external programme...</Button>-->
			<Button Click="SaveToFile">
				<StackPanel Orientation="Horizontal">
					<Image Source="{StaticResource Save}" Height="16" Margin="2"></Image>
					<Label Padding="2">Save to file</Label>
				</StackPanel>
			</Button>
			<Button Click="validateSchema">
				<StackPanel Orientation="Horizontal">
					<Image Source="{StaticResource Validate}" Height="16" Margin="2"></Image>
					<Label Height="Auto" Padding="2">Validate Xml schema</Label>
				</StackPanel>
			</Button>
		</ToolBar>
        
		<!--<StackPanel DockPanel.Dock="Bottom" Margin="5">
			<Button Height="23" Name="button1" Width="75" IsDefault="True" Click="button1_Click" IsCancel="True">Close</Button>
		</StackPanel>-->
        <DockPanel>
            <Expander Header="Translation results:"  MaxHeight="130"
								  Name="expander1" DockPanel.Dock="Bottom"
								  IsExpanded="False" ExpandDirection="Down">
                <ScrollViewer  VerticalScrollBarVisibility="Auto">
                    <StackPanel Margin="0,0,5,0">
                        <Label Name="lResult" FontSize="12" Visibility="Collapsed" >Translation successful</Label>
                        <!--<Expander DockPanel.Dock="Bottom" Grid.Row="1"  Header="Translation results:" Height="auto" Name="expander1" VerticalAlignment="Bottom" MaxHeight="100" IsExpanded="False" ExpandDirection="Down" VerticalContentAlignment="Bottom">-->
                        <DataGrid  CanUserReorderColumns="False" 
											AutoGenerateColumns="False"  CanUserResizeColumns="True" 
											CanUserSortColumns="True" BorderThickness="0" GridLinesVisibility="Horizontal" 
											HeadersVisibility="All" x:Name="gridLog" IsReadOnly="True" 
											CanUserResizeRows="False" VerticalScrollBarVisibility="Disabled" 
											HorizontalScrollBarVisibility="Disabled" FontSize="12" Margin="0" HorizontalGridLinesBrush="LightGray" IsTabStop="True" EnableRowVirtualization="False" VerticalContentAlignment="Bottom" HorizontalContentAlignment="Center">
                            <DataGrid.Columns>
                                <DataGridTemplateColumn Header="" MaxWidth="30" MinWidth="30" IsReadOnly="True" CanUserResize="False">
                                    <DataGridTemplateColumn.CellTemplate>
                                        <DataTemplate>
                                            <Image Width="16" Height="16" Source="{Binding Image}"/>
                                        </DataTemplate>
                                    </DataGridTemplateColumn.CellTemplate>
                                </DataGridTemplateColumn>
                                <DataGridTextColumn Header="#" Binding="{Binding Number}" MaxWidth="20" Width="*" />
                                <DataGridTextColumn Header="Text" Binding="{Binding MessageText}"  Width="*" x:Name="textcolumn">
                                    <DataGridTextColumn.ElementStyle>
                                        <Style TargetType="TextBlock">
                                            <Setter Property="TextWrapping" Value="Wrap">
                                            </Setter>

                                        </Style>
                                    </DataGridTextColumn.ElementStyle>
                                </DataGridTextColumn>
                                <DataGridTextColumn MinWidth="40"/>
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel>

                </ScrollViewer>
            </Expander>
            <avalonEdit:TextEditor Name="tbSchema" Padding="5"
                                   Dialogs:AccessKeyScoper.IsAccessKeyScope="True" 
                                   FontFamily="Consolas" 
                                   FontSize="12"
                                   Background="White"
                                   Language="XML"
                                   TextChanged="tbSchema_TextChanged" Margin="5">
                
            </avalonEdit:TextEditor>
            <!--<TextBox Grid.Row="0" Name="tbSchema"   Text=""  Margin="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" AcceptsTab="True">

            </TextBox>-->
        </DockPanel>
        <!--<TabControl Name="tabControl1" SelectionChanged="tabControl1_SelectionChanged">
			<TabItem Header="Default view" >-->
				
			<!--</TabItem>
            <TabItem Header="Browser view" Name="tbBrowser">
				<WebBrowser Grid.Column="1" Name="wbSchema" Height="auto"
							 VerticalAlignment="Center" Margin="3,0,0,0"></WebBrowser>
			</TabItem>
		</TabControl>-->
	</DockPanel>
</ad:DocumentContent>
